import { defHttp } from '/@/utils/http/axios'

import { NoticeSO, NoticeVO } from './model/noticeModel'
import { BasicFetchResult, BasicPageParams } from '/@/api/model/baseModel'

enum Api {
  listNotice = '/notice/list',
  readNotice = '/notice/read',
  readAllNotice = '/notice/readAll',
}

export const listNotice = () => {
  return defHttp.post<NoticeVO[]>({ url: Api.listNotice }, { errorMessageMode: 'message' })
}

export const readNotice = (data) => {
  return defHttp.get<Boolean>(
    { url: Api.readNotice, params: { id: data } },
    { errorMessageMode: 'message' },
  )
}

export const readAllNotice = () => {
  return defHttp.get<Boolean>({ url: Api.readAllNotice }, { errorMessageMode: 'message' })
}
